import socket  
import time
import binascii
from hex import HexStrFromFile


    
if __name__ == '__main__':
    print 'start'  
 
    client = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
    print client
    
    hexstr = HexStrFromFile('d:\\1.txt')
    frame = binascii.a2b_hex(hexstr)
    frame = frame[:100]
    while 1:
        rs = client.sendto( frame, ('192.168.5.63', 700) ) 
        now = time.localtime()
        print time.strftime('%Y-%m-%d %H:%M:%S'), 'send', rs

        time.sleep(1) 
    
 
        
    client.close()
    
    print 'end'